<template>
  <div class="home-recommend">
    <ul class="recommend">
      <li v-for="(item,index) in recommends" :key="index">
        <a :href="item.link">
          <img :src="item.image" alt="err-load">
          <div :style="titleColor">{{item.title}}</div>
        </a>        
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HomeRecommend",
  props: {
    // 推荐的数据在首页中请求过来了，需要从home页传过来
    recommends: {
      type: Array,
      default() {
        return [
          {
            image: require("@/assets/home_images/scroll_imgs/1.jpg"),
            title: "蓝帽子小可爱",
          },
          {
            image: require("@/assets/home_images/scroll_imgs/6.jpg"),
            link:"https://cn.bing.com/?FORM=BEHPTB",
            title: "三根毛小白",
          },
          {
            image: require("@/assets/home_images/scroll_imgs/5.jpg"),
            title: "三根毛小白",
          },
          {
            image: require("@/assets/home_images/scroll_imgs/4.jpg"),
            title: "三根毛小白",
          },
          
        ];
      },
    },
    titleColor: {
      type: String,
      default: 'red'
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {},
};
</script>

<style scoped>
.home-recommend{
  text-align: center;
  width: 100%;
}
.recommend {
  width: 100%;
  display: flex;
  padding: 10px 0 10px;
  border-bottom: 5px solid #eee;
}
img{
  width:80px;
  height: 80px;
  margin-bottom: 5px;
  /* border-radius: 50%; */
}
ul li{
  display: inline-block;
  flex: 1;
}
</style>
